package com.example.springbootdemo.service;

import com.example.springbootdemo.dao.DeptDao;
import com.example.springbootdemo.dao.EmpDao;
import com.example.springbootdemo.po.Dept;
import com.example.springbootdemo.po.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

    @Service
    @Transactional
    public class EmpServiceImpl implements EmpService {

        @Autowired
        private EmpDao empDao;

        @Override
        @Transactional(readOnly = true)
        public List<Emp> queryEmp(Emp emp) {
            return this.empDao.queryEmp(emp);
        }

        @Override
        public void addEmp(Emp emp) {
            this.empDao.addEmp(emp);

        }

        @Override
        public void updateEmp(Emp emp) {
            this.empDao.updateEmp(emp);
        }

        @Override
        public void delEmp(Integer empNo) {
            this.empDao.delEmp(empNo);

        }
    }

